﻿<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="ObjectToOperate"></xsl:param>
  <xsl:template match="/DataSet">
    public int InsertUpdate_<xsl:value-of select="$ObjectToOperate"/>(<xsl:for-each select="Table">
      <xsl:value-of select="DataType"/><xsl:text> </xsl:text><xsl:value-of select="Parameter"/><xsl:if test="position() != last()">,</xsl:if>
    </xsl:for-each>)
    {
      SPAutoParameters param = new SPAutoParameters();
      
      int result = new DALHelper(ConnectionString).ExecutScalarProcedure(SPAutoParameters.SP_<xsl:value-of select="$ObjectToOperate"/>, param.<xsl:value-of select="$ObjectToOperate"/>_Parameters(<xsl:for-each select="Table">
      <xsl:text> </xsl:text><xsl:value-of select="Parameter"/><xsl:if test="position() != last()">,</xsl:if>
    </xsl:for-each>));
      return result;
    }    
  </xsl:template>
</xsl:stylesheet>